<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
<form action="" method="get">
    标题：<input type="text" name="title"><br>
    内容：<textarea name="content" id="" cols="25" rows="10"></textarea><br>
    <input type="reset" value="重置">
    <input type="submit" name="sub" value="提交">
</form>
</body>
</html>
<?php
/**
 * User: lie
 * Date: 2020/11/10 9:10
 * description: 自定义函数始兴县字符转义。
 * Error: 使用preg_replace 正则替换，未完成
 */
    function str($str){
        $str = preg_replace("//", "&nbsp;", $str);
        $str = preg_replace("/cga(13)/", "<br>", $str);
        echo "内容：".$str;
    }
    echo "标题：".$_GET['title'];
    echo "<br>";
    str($_GET['content']);
